package own.stu.jobgib.playown.thrift;

import org.apache.thrift.TException;

public class PersonServiceImpl implements PersonService.Iface {

    @Override
    public Person getById(int id) throws TException {
        System.out.println("getById: " + id);
        Person person = new Person().setAge(1).setId(id).setName("xx").setIsMarried(true);
        return person;
    }

    @Override
    public void save(Person person) throws DataException, TException {
        if(person == null || person.getId() == 0){
            throw new DataException(0, "param is null");
        }

        System.out.println(person);
    }
}
